
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark" >
  <div class="container">
    <div class="navbar-header">
      <a class="navbar-brand" href="/">
        <img width="90px" src="/public/img/haizeiwang.jpg" alt="/">
      </a>
    </div>
    <div class="person" id="bs-example-navbar-collapse-1" style="display: flex;">
      <form class="form-inline">
        <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
        <!-- <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button> -->
      </form>
      <ul class="navbar navbar-expand-lg navbar-light bg-ligh" style="display: flex; float: right; list-style: none ; margin-bottom: 0;">
        {{ if user }}
        <!-- <li class="nav-item">
          
        </li> -->
        <span>
          <a class="btn btn-light" href="/topics/new" >留言</a>
        </span>
        
        <li class="nav-item dropdown" >
          <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true"
          aria-expanded="false" style="color: white;">
            详细信息
          </a>
          <div class="dropdown-menu " aria-labelledby="navbarDropdownMenuLink">
           
            <span  class="dropdown-item"> 当前登录用户: <a href="">{{ user.nickname }}</a></span>
            
            <a class="dropdown-item" href="/settings/profile">个人主页</a>
            <a class="dropdown-item" href="/settings/profile">设置</a>
            <a class="dropdown-item" href="/logout">退出</a>
          </div>
        </li>
        <a href="">
          <img width="30" height="30" src="{{user.avatar}}" alt=""> 
        </a>
        {{ else }}
          <span>
            <a class="btn btn-primary navbar-btn" href="/login">登录</a>
            <a class="btn btn-success navbar-btn" href="/register">注册</a>
          </span>
        {{ /if }}
      </ul>
    </div>
  </div>
</nav>
<!-- <nav class="navbar navbar-inverse navbar-fixed-top">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#">Project name</a>
    </div>
    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav navbar-right">
        <li><a href="#">Dashboard</a></li>
        <li><a href="#">Settings</a></li>
        <li><a href="#">Profile</a></li>
        <li><a href="#">Help</a></li>
      </ul>
      <form class="navbar-form navbar-right">
        <input type="text" class="form-control" placeholder="Search...">
      </form>
    </div>
  </div>
</nav> -->